package erQiao.yfl.app.controller;

import erQiao.yfl.app.controller.Vo.CommentVo;
import erQiao.yfl.app.dao.entity.Comment;
import erQiao.yfl.app.service.CommentService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * 评论
 */
@Controller
@RequestMapping("/comment")
public class CommentController {
    @Resource
    private CommentService commentService;

    @RequestMapping("/insertComment")
    public void insertCircle(@RequestBody CommentVo commentVo){
        Comment comment = new Comment();
        BeanUtils.copyProperties(commentVo,comment);
        commentService.insertComment(comment);
    }

}
